<?php

class RadioButton {

    public function __construct($id, $label) {
        $this->id = $id;
        $this->label = $label;
        $this->itemscode = "";
    }

    public function addItem($RBItem) {//Adding a RadioButtonItem to a RadioButton
        if (strlen($this->itemscode) > 0) {
            $this->itemscode = $this->itemscode . Sympols::$split4 . $RBItem->getCode();
        } else {
            $this->itemscode = $RBItem->getCode();
        }
    }

    public function getCode() {
        return "radiobutton" . Sympols::$split3 . $this->id . Sympols::$split3 . $this->label . Sympols::$split3 . $this->itemscode;
    }

}

?>
